﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dao
{
    public enum JCCDType  // 0 进； 1 出
    {
        IN = 0,
        OUT = 1
    }

    public class CS_DJLX
    {
        public static readonly string TYPE_KEY = "1000";

        public string BH {get; set;}
        public string MC {get; set;}
        public JCCDType Type { get; set; }

        public static JCCDType Parse(string key)
        {
            return key.CompareTo(TYPE_KEY) < 0 ? JCCDType.IN : JCCDType.OUT;
        }
    }

    public class CS_DJLX_Dao 
    {
        public static List<CS_DJLX> JCDLX { get; set; }
        public static List<CS_DJLX> CCDLX { get; set; }

        static CS_DJLX_Dao()
        {
            JCDLX = new List<CS_DJLX>();
            JCDLX.Add(new CS_DJLX() { BH = "0001", MC = "物料进仓", Type = JCCDType.IN });
            JCDLX.Add(new CS_DJLX() { BH = "0002", MC = "产品进仓", Type = JCCDType.IN });
            JCDLX.Add(new CS_DJLX() { BH = "0003", MC = "调拨进仓", Type = JCCDType.IN });

            CCDLX = new List<CS_DJLX>();
            CCDLX.Add(new CS_DJLX() { BH = "1001", MC = "物料出仓", Type = JCCDType.OUT });
            CCDLX.Add(new CS_DJLX() { BH = "1002", MC = "产品出仓", Type = JCCDType.OUT });
            CCDLX.Add(new CS_DJLX() { BH = "1003", MC = "调拨出仓", Type = JCCDType.OUT });
        }

        public static List<CS_DJLX> GetDJLXByType(string key)
        {
            return GetDJLXByType(CS_DJLX.Parse(key));
        }

        public static List<CS_DJLX>  GetDJLXByType(JCCDType type)
        {
            if (type == JCCDType.IN)
            {
                return JCDLX;
            }
            else
            {
                return CCDLX;
            }
        }

    }
}
